/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pojo;

import java.util.Date;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;

/**
 *
 * @author pvhuy
 */
@Entity
@Table(name = SanPham.TABLE_SANPHAM)
public class SanPham extends Base {

    public static final String TABLE_SANPHAM = "SanPham";
    protected static final String COLUMN_TENSANPHAM = "TenSanPham";
    private static final int LENGTH_TENSANPHAM = 45;
    @Column(name = COLUMN_TENSANPHAM, length = LENGTH_TENSANPHAM, nullable = false)
    private String tenSanPham;
    protected static final String COLUMN_HINHANHMIHHOA = "HinhAnhMinhHoa";
    private static final int LENGTH_HINHANHMINHHOA = 45;
    @Column(name = COLUMN_HINHANHMIHHOA, length = LENGTH_HINHANHMINHHOA)
    private String hinhAnhMinhHoa;
    protected static final String COLUMN_MOTASANPHAM = "MoTaSanPham";
    private static final int LENGTH_MOTASANPHAM = 45;
    @Column(name = COLUMN_MOTASANPHAM, length = LENGTH_MOTASANPHAM)
    private String moTaSanPham;
    protected static final String COLUMN_GIABANHIENTAI = "GiaBanHienTai";
    @Column(name = COLUMN_GIABANHIENTAI)
    private float giaBanHienTai;
    protected static final String COLUMN_SOLUONGDANGCO = "SoLuongDangCo";
    @Column(name = COLUMN_SOLUONGDANGCO)
    private int soLuongDangCo;
    protected static final String COLUMN_ISBN = "ISBN";
    private static final int LENGTH_ISBN = 45;
    @Column(name = COLUMN_ISBN, length = LENGTH_ISBN)
    private String ISBN;
    protected static final String COLUMN_NHASANXUAT = "MaNhaSanXuat";
    @ManyToOne(cascade = CascadeType.ALL)
    @JoinColumn(name = COLUMN_NHASANXUAT)
    private NhaSanXuat nhaSanXuat;
    protected static final String COLUMN_THELOAI = "MaTheLoai";
    @ManyToOne(cascade = CascadeType.ALL)
    @JoinColumn(name = COLUMN_THELOAI)
    private TheLoai theLoai;

    protected static final String COLUMN_NGAYNHAP = "NgayNhap";
    @Column(name = COLUMN_NGAYNHAP)
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date ngayNhap;

    protected static final String COLUMN_TENTACGIA = "TenTacGia";
    private static final int LENGTH_TENTACGIA = 100;
    @Column(name = COLUMN_TENTACGIA, length = LENGTH_TENTACGIA)
    private String tenTacGia;

    protected static final String COLUMN_NGAYXUATBAN = "NgayXuatBan";
    @Column(name = COLUMN_NGAYXUATBAN)
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date ngayXuatBan;
    /**
     * @return the tenSanPham
     */
    public String getTenSanPham() {
        return tenSanPham;
    }

    /**
     * @param tenSanPham the tenSanPham to set
     */
    public void setTenSanPham(String tenSanPham) {
        this.tenSanPham = tenSanPham;
    }

    /**
     * @return the hinhAnhMinhHoa
     */
    public String getHinhAnhMinhHoa() {
        return hinhAnhMinhHoa;
    }

    /**
     * @param hinhAnhMinhHoa the hinhAnhMinhHoa to set
     */
    public void setHinhAnhMinhHoa(String hinhAnhMinhHoa) {
        this.hinhAnhMinhHoa = hinhAnhMinhHoa;
    }

    /**
     * @return the moTaSanPham
     */
    public String getMoTaSanPham() {
        return moTaSanPham;
    }

    /**
     * @param moTaSanPham the moTaSanPham to set
     */
    public void setMoTaSanPham(String moTaSanPham) {
        this.moTaSanPham = moTaSanPham;
    }

    /**
     * @return the giaBanHienTai
     */
    public float getGiaBanHienTai() {
        return giaBanHienTai;
    }

    /**
     * @param giaBanHienTai the giaBanHienTai to set
     */
    public void setGiaBanHienTai(float giaBanHienTai) {
        this.giaBanHienTai = giaBanHienTai;
    }

    /**
     * @return the soLuongDangCo
     */
    public int getSoLuongDangCo() {
        return soLuongDangCo;
    }

    /**
     * @param soLuongDangCo the soLuongDangCo to set
     */
    public void setSoLuongDangCo(int soLuongDangCo) {
        this.soLuongDangCo = soLuongDangCo;
    }

    /**
     * @return the ISBN
     */
    public String getISBN() {
        return ISBN;
    }

    /**
     * @param ISBN the ISBN to set
     */
    public void setISBN(String ISBN) {
        this.ISBN = ISBN;
    }

    /**
     * @return the nhaXuatBan
     */
    public NhaSanXuat getNhaXuatBan() {
        return nhaSanXuat;
    }

    /**
     * @param nhaXuatBan the nhaXuatBan to set
     */
    public void setNhaXuatBan(NhaSanXuat nhaSanXuat) {
        this.nhaSanXuat = nhaSanXuat;
    }

    /**
     * @return the theLoai
     */
    public TheLoai getTheLoai() {
        return theLoai;
    }

    /**
     * @param theLoai the theLoai to set
     */
    public void setTheLoai(TheLoai theLoai) {
        this.theLoai = theLoai;
    }

    public Date getNgayNhap() {
        return ngayNhap;
    }

    public void setNgayNhap(Date ngayNhap) {
        this.ngayNhap = ngayNhap;
    }

    public Date getNgayXuatBan() {
        return ngayXuatBan;
    }

    public void setNgayXuatBan(Date ngayXuatBan) {
        this.ngayXuatBan = ngayXuatBan;
    }

    public String getTenTacGia() {
        return tenTacGia;
    }

    public void setTenTacGia(String tenTacGia) {
        this.tenTacGia = tenTacGia;
    }

}
